package com.study.forumsystemproject.dao;

import com.study.forumsystemproject.model.Board;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BoardMapper {

    int insert(Board row);

    int insertSelective(Board row);

    Board selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Board row);

    int updateByPrimaryKey(Board row);

    @Select("select id,name, articleCount from t_board  where deleteFlag = 0" +
            " and state = 0 order by sort asc limit 0,#{num}")
    List<Board> selectAllBoardByNum(Integer num);
}